<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('LoginReg/getVcode', [\App\Http\Controllers\UserController::class, 'getVcode']);

Route::post('LoginReg/login', [\App\Http\Controllers\UserController::class, 'login']);

Route::get('Novel/getNovelDetail', [\App\Http\Controllers\NovelController::class, 'getNovelDetail']);

Route::get('Novel/read', [\App\Http\Controllers\NovelController::class, 'read']);

Route::get('Novel/getChapterList', [\App\Http\Controllers\NovelController::class, 'getChapterList']);

Route::get('Novel/searchNovel', [\App\Http\Controllers\NovelController::class, 'search']);

Route::get('Novel/getRandomRec', [\App\Http\Controllers\NovelController::class, 'getRandomRec']);

Route::get('Essence/getLists', [\App\Http\Controllers\EssenceController::class, 'getEssenceLists']);

Route::get('Essence/getBanner', [\App\Http\Controllers\EssenceController::class, 'getBanner']);

Route::get('Comment/getCommentList', [\App\Http\Controllers\CommentController::class, 'getList']);

Route::get('dev/coupon', [\App\Http\Controllers\UserController::class, 'devUserCoupon']);

Route::get('Novel/tags', [\App\Http\Controllers\NovelController::class, 'getAllTag']);

Route::get('Novel/getNovelByTag', [\App\Http\Controllers\NovelController::class, 'getNovelsByTag']);

Route::get('Constellation/get', [\App\Http\Controllers\ConstellationController::class, 'getConstellValue']);

Route::middleware('login')->group(function () {
    Route::post('File/uploadHeadIcon', [\App\Http\Controllers\FileController::class, 'uploadUserHeadPic']);

    Route::post('Comment/createComment', [\App\Http\Controllers\CommentController::class, 'publishComment']);

    Route::get('/Shelf/add', [\App\Http\Controllers\ShelfController::class, 'up']);

    Route::get('/Shelf/delete', [\App\Http\Controllers\ShelfController::class, 'down']);

    Route::get('Shelf/lists', [\App\Http\Controllers\ShelfController::class, 'shelfLists']);

    Route::get('User/userCenter', [\App\Http\Controllers\UserController::class, 'userCenter']);

    Route::get('Novel/getReadLog', [\App\Http\Controllers\UserController::class, 'getUserReadLog']);

    Route::get('User/getConsumptionLog', [\App\Http\Controllers\UserController::class, 'getUserConsumptionLog']);

    Route::post('User/changeUserInfo', [\App\Http\Controllers\UserController::class, 'changeUser']);

    Route::any('User/logOut', [\App\Http\Controllers\UserController::class, 'logout']);
});
